import api from '../../api/resources'
import {ARTICLE_DETAIL} from '../mutation-types'

const state = {
  detail: 'sss'
}

const getters = {
  detail (state) {
    return state.detail
  }
}

const actions = {
  getDetail ({commit}, id) {
    api.getDetail(id).then(res => {
      commit(ARTICLE_DETAIL, res)
    })
  }
}

const mutations = {
  [ARTICLE_DETAIL] (state, res) {
    state.detail = res.data
  }
}

export default {
  state,
  actions,
  getters,
  mutations
}
